/**********************************************************
 * File: i2c-net.h
 * 
 */


#ifndef __I2C_NET_H__
#define __I2C_NET_H__
#include <map>
#include <string>
#include "i2cNet.h"
#include "i2cDevice.h"
#include <iostream>

class i2cNet
{
public:
    static const unsigned long REV_NUMBER;
    static const std::string REV_URL;
    static const std::string REV_DATE;
 
    static void printRevisionInfo(std::ostream& out);

    typedef enum Status
    {
        SUCCESS   = 0,
        FAILURE   = 1,
        NOT_OPEN  = 2,
        BAD_PARAM = 3,
        NO_DEVICE = 4,
        TIMEOUT   = 5
    };

    i2cNet(const std::string& name);
    virtual ~i2cNet();

    Status connect();

    Status disconnect();

    bool connected();

    Status addDevice(i2cDevice& device);

    Status removeDevice(const std::string& name);

    Status removeDevice(const i2cDevice& device);

    i2cDevice getDevice(const std::string&);

private:
    std::string m_name;
    int m_fd;
    std::map<std::string, i2cDevice> m_devices;
};




#endif /* __I2C_NET_H__ */
